package com.lanzhou.yuanfen.diary.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lanzhou.yuanfen.diary.entity.Mood;
import com.lanzhou.yuanfen.diary.mapper.MoodMapper;
import com.lanzhou.yuanfen.diary.service.IMoodService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lcllge
 * @since 2020-07-28
 */
@Service
@CacheConfig(cacheNames = "mood", keyGenerator = "myKeyGenerator")
public class MoodServiceImpl extends ServiceImpl<MoodMapper, Mood> implements IMoodService {

    @Override
    @Cacheable(value = "mood", keyGenerator = "myKeyGenerator")
    public List<Mood> redisCache() {
        return list();
    }

}
